//
//  IndoorMapViewNew.h
//  WisdomMallAPP
//
//  Created by apple on 14-1-13.
//  Copyright (c) 2014年 apple. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MifFileReader.h"
#import "MyPositon.h"
#import "FacilityPoints.h"
#import "PrimitivePoints.h"

#import "SVGKit.h"
#import "CALayerExporter.h"
#import "SVGKImage.h"
#import "AStar.h"
#import "AStarItem.h"
#import "IndoorMapPathView.h"

@protocol IndoorMapViewNewDelegate <NSObject>

@optional
- (void)touchPosition:(CGPoint)point content:(PrimitivePoints *)content;
- (void)touchPosition:(CGPoint)point;
@end


@interface IndoorMapViewNew : UIView<UIPopoverControllerDelegate, UISplitViewControllerDelegate,
#if V_1_COMPATIBILITY_COMPILE_CALAYEREXPORTER_CLASS
CALayerExporterDelegate,
#endif
UIScrollViewDelegate>
{
    NSMutableArray *facilitiesArray;
    
    NSMutableArray *pathArray;
    
    int sIndex;
    
    //for find path
//    BOOL isFindingcar;//寻车
//    BOOL isStartMap;//
//    BOOL isSameFloor;
    
    //
    MyPositon *myPosition;
    MyPositon *endPositon;
    
    //最短距离的电梯口（能通往车库的）
    FacilityPoints *minDistancePoint;
    
    //animation
    UIImageView *_personImageView;
    
    BOOL _isShowing;
    
    //ios7
    CGFloat _offset_y;
    //路径搜索
    AStar *astar;
    
    //画路径
    NSMutableArray *newPath;
    IndoorMapPathView *pathView;
}

@property (weak, nonatomic) id<IndoorMapViewNewDelegate>delegate;


@property (strong, nonatomic) NSMutableArray *pointsArray;

@property (assign, nonatomic) float previousScale;
@property (assign, nonatomic) BOOL animationFinished;
@property (assign, nonatomic) int facilityType;
@property (nonatomic, strong) SVGKSource *sourceOfCurrentDocument;
@property (strong, nonatomic) SVGKImageView *contentView;
@property (strong, nonatomic) UIImageView *userImage;
@property (strong, nonatomic) UIImageView *endImage;
@property(nonatomic,strong)NSString * floor;

- (void)setMapImage:(UIImage *)image;

/**
 *  画商场地图路径
 */
- (NSMutableArray *)findPathStartX:(CGFloat)startX
                             statY:(CGFloat)startY
                              endX:(CGFloat)endX
                              endY:(CGFloat)endY
                          filePath:(NSString *)filePath;

/**
 *  画线
 */
- (void)drawPaths:(NSMutableArray *)path;
- (void)cleanPath;
- (void)loadSVGFrom:(SVGKSource *) svgSource rangeString:(NSString *)rangeString;
- (void)clearSubviews;
- (NSMutableArray *)fetchFacilityPoint:(NSString *)filePath;
- (void)drawStoreNames:(NSArray *)array;
@end
